import {messages} from "share/common";
import React from 'react';
import 'styles/components/simple-flow/nodes-panel.scss'
import SVGIcon from "components/SVGIcon";
/**
 * 节点列表，这里偷了个懒用了flex
 * 如果要兼容IE9请改一下布局
 *
 * @param props
 * @return {*}
 * @constructor
 */
function NodesPanel(props) {
  return (
    <div className="nodes-panel">
      <div className="panel-title">{messages('components.key907')/*请选择节点类型*/}</div>
      <div className="node-list">
        {props.nodeList.filter(node => node.manually).map(node => (
          <div  className={`node-item ${node.icon}`} onClick={e => props.onClickNode(node.type)}>
            <div className="node-icon">
              <SVGIcon type={node.icon}/>
            </div>
            <div className="node-title">
              {node.title}
            </div>
          </div>
        ))}
      </div>
    </div>
  )
}

export default NodesPanel;
